<script>
    function rel_del(reply_id, id_num) {

        id_num = id_num.toString();
        var AjaxUrl = "/reply_j/delete/" + reply_id;
        $.getJSON(AjaxUrl, function (Json) {
            $("#del_info_" + id_num).html('');
        });

    }
</script>
<div class="row">
    <div class="col-md-10">
        <div class="panel panel-black">
            <div class="panel-heading">
                <span class="glyphicon glyphicon-envelope"></span>
                {% if kwd['ext_field'] == '1' %}
                土肥问答
                {% elif kwd['ext_field'] == '2' %}
                植保问答

                {% elif kwd['ext_field'] == '3' %}
                育种问答
                {% else %}
                热门问答
                {% end %}
                (<span style="color: #f00;"> {{ info_count }} </span>)
                <a onclick="js_show_page('/reply_j/_add')" class="btn btn-default">提问</a>
            </div>
            <div class="panel-body">
                <table class="table">
                    <thead>
                    <tr>

                        <th>问题描述</th>

                        <th>所属领域</th>
                        <th>提问时间</th>
                        <th>操作</th>

                    </tr>
                    </thead>

                    {% set ii = 0 %}


                    {% for x in infos %}

                    <tr id="del_info_{{ ii }}">

                        <td>

                            {{ x.cnt_md }}


                        </td>

                        <td>
                            {% if x.extinfo.get('ext_field') == '1' %}
                            土肥
                            {% elif x.extinfo.get('ext_field') == '2' %}
                            植保
                            {% else %}
                            育种
                            {% end %}
                        </td>
                        <td>
                            {{ str(x.date)[:-7] }}
                        </td>
                        <td>
                            <a onclick="js_show_page('/reply_j/get/{{ x.uid }}')" target="_blank">
                                <span class="glyphicon glyphicon-eye-open"></span>
                                查看
                            </a>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <a onclick="rel_del('{{ x.uid }}', {{ ii }} );" class="trash" target="_blank">
                                <span class="glyphicon glyphicon-trash"></span>
                                删除
                            </a>

                        </td>
                    </tr>
                    {% set ii = ii + 1 %}
                    {% end %}


                </table>

            </div>

        </div>
        {% module admin_reply_pager(kwd['current_page'],ext_field=kwd['ext_field']) %}
    </div>

</div>
